public class Constructor01 {

    public static void main(String[] args) {

        Peron p = new Peron("小明",23);
//        String name =
        p.show();

        System.out.println(p.name);

        Peron p2 = new Peron( );
        p2.show();
//        System.out.println(p.name);

    }

}


class Peron{
    String name;
    int age;
    public Peron(){
        System.out.println("构造器被调用1111111~~~~~~~");
    }

//    构造器
    public Peron(String pName,int pAge){
        System.out.println("构造器被调用222222~~~~~~~");
        name = pName;
        age = pAge;
    }

    public void show(){
        System.out.println(name + ":" + age);
    }
}